package org.codeart.juc.lock;

import java.util.concurrent.locks.ReentrantLock;

public class CompanyTest {

    public static void main(String[] args) {
        // 默认是非公平锁
        ReentrantLock lock = new ReentrantLock(false);
        // 有参构造为 true 那就是公平锁
        ReentrantLock lock1 = new ReentrantLock(true);
        
        lock.lock();
        try {
            System.out.println("business code");
        } finally {
            lock.unlock();
        }
    }

}
